//
//  YLJTabBarController.m
//  ACE
//
//  Created by Mickey Yin on 2021/12/1.
//

#import "YLJTabBarController.h"
#import "YLJNavigationController.h"
#import "HomeViewController.h"
#import "MapViewController.h"
#import "MineViewController.h"

@interface YLJTabBarController ()

@end

@implementation YLJTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
    
    HomeViewController *home = [[HomeViewController alloc]init];
    [self addChildVc:home title:@"首页" image:@"tabbar_home" selectedImage:@"tabbar_home_selected"];
    
    MapViewController *fenlei = [[MapViewController alloc]init];
    [self addChildVc:fenlei title:@"分类" image:@"tabbar_mine" selectedImage:@"tabbar_mine_selected"];
    
    MineViewController *mine = [[MineViewController alloc]init];
    [self addChildVc:mine title:@"我的" image:@"tabbar_home" selectedImage:@"tabbar_home_selected"];
    
}


- (void )addChildVc:(UIViewController *)childVc title:(NSString *)title image:(NSString *)image selectedImage:(NSString *)selectedImage {
    
    childVc.tabBarItem.title = title;
    childVc.tabBarItem.image = [[UIImage imageNamed:image]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    childVc.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    if (@available(iOS 13.0, *)) {
        //self.tabBar.tintColor = kMainColor;
        //self.tabBar.unselectedItemTintColor =KGG66Color;
    }
    YLJNavigationController *nav = [[YLJNavigationController alloc]initWithRootViewController:childVc];
    [self addChildViewController:nav];
}


@end
